import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

import 'form_edit_status_inherited_widget.dart';

class EmployeeContributionForm extends StatelessWidget {
  final String shg;
  final num amount;

  EmployeeContributionForm({Key key, this.shg, this.amount}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color: Colors.white,
          border: Border(
              bottom: BorderSide(
            color: aceGrayColor,
            width: getDp(0.5),
          ))),
      padding: EdgeInsets.symmetric(horizontal: getDp(35), vertical: getDp(10)),
      child: Row(
        children: [
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Padding(
                  padding: EdgeInsets.only(
                    bottom: getDp(10),
                  ),
                  child: Text(
                    S.current.shg,
                    style: TextStyle(
                      color: aceDarkGrayColor,
                      fontSize: getSp(14),
                      fontWeight: FontWeight.w400,
                      height: 1,
                    ),
                  ),
                ),
                Text(
                  shg,
                  style: FormEditStatusInheritedWidget.ofStyle(context),
                )
              ],
            ),
          ),
          Column(
            crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              Padding(
                padding: EdgeInsets.only(
                  bottom: getDp(10),
                ),
                child: Text(
                  S.current.contribution,
                  style: TextStyle(
                    color: aceDarkGrayColor,
                    fontSize: getSp(14),
                    fontWeight: FontWeight.w400,
                    height: 1,
                  ),
                ),
              ),
              Container(
                constraints: BoxConstraints(
                  minWidth: getDp(60),
                ),
                child: Text(
                  amount == null
                      ? "NA"
                      : (amount == 0
                          ? S.current.statutory_default
                          : S.current.custom_amount),
                  style: TextStyle(
                    color: FormEditStatusInheritedWidget.ofEnable(context)
                        ? aceBlueColor
                        : aceBlackColor,
                    fontSize: getSp(18),
                    fontWeight: FontWeight.w700,
                    height: 14 / 18,
                  ),
                ),
              )
            ],
          ),
        ],
      ),
    );
  }
}
